from django.urls import path,re_path
from course.views import IndexView,CourseCategoryListApiew,CourseDirectionListApiew,CourseListApiew,CourseDetaileViews,\
CourseChapterListApiview,CourseSearchViewSet
from rest_framework import routers

router = routers.DefaultRouter()
router.register('search',CourseSearchViewSet,basename="course_search")
urlpatterns = [
    path('index/',IndexView.as_view()),
    path('direction/',CourseDirectionListApiew.as_view()),
    re_path(r'^course/(?P<directionID>\d+)/(?P<categoryID>\d+)/$',CourseListApiew.as_view()),
    re_path(r'detailes/(?P<courseID>\d+)/$',CourseDetaileViews.as_view()),
    re_path(r'(?P<courseID>\d+)/chapters/$',CourseChapterListApiview.as_view()),
    # path('category/',CourseCategoryListApiew.as_view()),
    re_path(r'^category/(?P<directionID>\d+)/$',CourseCategoryListApiew.as_view()),

]
urlpatterns += router.urls
